package com.kashi.controller;

import com.kashi.pojo.Collection;
import com.kashi.pojo.Result;
import com.kashi.service.CollectionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/api")
public class CollectionController {

/*    @Autowired
    private CollectionService collectionService;

    @GetMapping("/collections")
    public Result getCollections(@RequestHeader("Authorization") String authorizationHeader) {
        // 检查 Authorization 头是否存在
        if (authorizationHeader == null || authorizationHeader.isEmpty()) {
            return Result.error("Authorization header is missing");
        }

         //在这里进行身份验证，验证令牌的有效性

         //返回合集列表或者其他数据
         List<Collection> collections = collectionService.getCollections(Integer userId);

         //返回响应数据
         return Result.success(collections);
    } */


}

